
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2522. -- [Shoi2010]团队游戏 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2522: [Shoi2010]团队游戏</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>0&nbsp;&nbsp;<span class=green>Solved: </span>0<br>[<a href='submitpage.php?id=2522'>Submit</a>][<a href='problemstatus.php?id=2522'>Status</a>][<a href='bbs.php?id=2522'>Discuss</a>]</center><h2>Description</h2><div class=content><div style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%"><span style="font-size: medium">自从NOI的比赛加入了团体赛，SHOI的领队就发现培养学生之间的团队协作精神是十分重要的。所以，今年SHOI的领队就决定，在上海代表队选拔赛结束后，组织大家在大草坪上做一个团队游戏，培养选手之间的默契、协作。</span></div>
<div style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%"><span style="font-size: medium">现在Secsa&ldquo;偷偷&rdquo;地把这个小游戏的内容告诉你，也许你到时候可以赢得小游戏的冠军，获得一份特别的小礼品哦！</span></div>
<div style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%"><span style="font-size: medium">这是一个每两人为一队的、需要双人配合的游戏。游戏中会有一根绳子系在作为队友的两人身上，也就是说在整个游戏过程中，两人之间的距离不能超过这根绳子的长度。</span></div>
<p></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">游戏开始之前，大草坪上画上了一个简单多边形（边界不自交，但既可能是凸的也可能是凹的）。</span></font></span><font size="3"><font face="宋体"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;"><o:p></o:p></span></font></font></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">同一队的两人可以自由的在多边形上选一点一同出发，但出发时他们是背对背的。整个游戏的过程中两人可以沿着多边形的边界向前走或者向后退，如果他们两人能够最终面对面地相遇，那么他们就胜利了。整个游戏过程中，反转方向是不允许的</font></span></span><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftn1" name="_ftnref1"></a><span style="font-size: medium"><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftn1" name="_ftnref1"><span class="MsoFootnoteReference"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;"><span style="mso-special-character: footnote"><span class="MsoFootnoteReference"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">[1]</span></span></span></span></span></a><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">。如</span>图 <span lang="EN-US" style="mso-no-proof: yes">5</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">中所示，只要系在两人身上的绳子的长度不少于</span></font><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;">W</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">，那么两人就可以沿箭头方向朝前走，并最终胜利。</span></font></span></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><img alt="" src="/JudgeOnline/upload/201111/1(6).jpg" /></span></font></span></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><span style="font-size: medium"><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">显然，系在队友身上的绳子越短，想要获胜的难度越高。所以，你现在的任务就是根据草坪上画的多边形的形状计算出：能够完成游戏并胜利的最短的绳子的长度。</span></font></span><font size="3"><font face="宋体"><span lang="EN-US" style="font-family: &quot;Times New Roman&quot;"><o:p></o:p></span></font></font></p>
<div style="mso-element: footnote-list">
<p></p>
<p></p>
<p><span style="font-size: medium"><br clear="all" />
</span><font face="宋体" size="3"><hr width="33%" align="left" size="1" />
</font></p>
<div id="ftn1" style="mso-element: footnote">
<p class="MsoFootnoteText" style="margin: 0cm 0cm 0pt"><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftnref1" name="_ftn1"></a><span style="font-size: medium"><a title="" style="mso-footnote-id: ftn1" href="http://61.187.179.132/JudgeOnline/fckeditor/editor/fckeditor.html?InstanceName=description&amp;Toolbar=Default#_ftnref1" name="_ftn1"><span class="MsoFootnoteReference"><span lang="EN-US"><span style="mso-special-character: footnote"><span class="MsoFootnoteReference"><span lang="EN-US" style="font-family: 'Times New Roman'; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">[1]</span></span></span></span></span></a><span lang="EN-US"><font face="Times New Roman"> </font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于每一个简单多边形而言，都有两种方式可以沿着其边缘环绕一周，这两种环绕方式的方向是相反的，我们称其中一种为正方向，另一种为负方向。例如，就一个凸多边形而言，有顺时针和逆时针两种方向相反的环绕方法。这里所说的&ldquo;反转方向是不允许的&rdquo;是指：在整个游戏的过程中，作为队友的</span><span lang="EN-US"><font face="Times New Roman">AB</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">两人，</span><span lang="EN-US"><font face="Times New Roman">A</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必须始终面朝着正方向，</span><span lang="EN-US"><font face="Times New Roman">B</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必须始终朝着负方向，但</span><span lang="EN-US"><font face="Times New Roman">AB</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">两人在任意时刻都可以前进或者后退，或者其中一人前进另一人后退。</span></span></p>
</div>
</div></div><h2>Input</h2><div class=content><p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><font size="3"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">输入文件的第一行有两个正整数</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">n</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">，表示多边形的边数。接下来</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">n</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">行，每行有两个整数</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">x</span><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">、</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">y</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">，依次描述多边形的顶点的坐标。</span><span lang="EN-US" style="font-family: 'Times New Roman'"><o:p></o:p></span></font></font></p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><font size="3"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">输入文件保证：这些点坐标的绝对值都不超过</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">100</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">。</span><span lang="EN-US" style="font-family: 'Times New Roman'"><o:p></o:p></span></font></font></p></div><h2>Output</h2><div class=content><p class="MsoNormal" style="margin: 0cm 0cm 0pt"><b style="mso-bidi-font-weight: normal"><span lang="EN-US" style="font-size: 12pt"><o:p></o:p></span></b>&nbsp;</p>
<p class="MsoPlainText" style="margin: 6pt 0cm 12pt; text-indent: 21pt; line-height: 150%; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: 1.0gd; mso-para-margin-left: 0cm; mso-char-indent-count: 2.0"><font size="3"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">输出文件只有一行，这行只有一个实数，即为能够完成游戏的最短的绳子的长度，保留</font></span><span lang="EN-US" style="font-family: 'Times New Roman'">3</span><font face="宋体"><span style="mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'">位小数。</span><span lang="EN-US" style="font-family: 'Times New Roman'"><o:p></o:p></span></font></font></p></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>4<br />
1 1<br />
1 3<br />
9 3<br />
9 1<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>2.000</span></div><h2>HINT</h2>
			<div class=content><p><p>1&lt;=N&lt;=100</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=Day2'>Day2</a></p></div><center>[<a href='submitpage.php?id=2522'>Submit</a>][<a href='problemstatus.php?id=2522'>Status</a>][<a href='bbs.php?id=2522'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
